# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=python-quart-cors
pkgver=0.7.0
pkgrel=1
pkgdesc='A Quart extension to provide Cross Origin Resource Sharing, access control, support'
url=https://github.com/pgjones/quart-cors
arch=(any)
license=(MIT)
depends=(
  python
  python-quart
)
makedepends=(
  git
  python-build
  python-installer
  python-poetry-core
)
checkdepends=(
  python-pytest
  python-pytest-asyncio
  python-pytest-cov
  python-pytest-sugar
  python-tox
)
_tag=e998af02d7a40b2dfd2acb656e0a981faef5e782
source=(git+https://github.com/pgjones/quart-cors.git#tag=${_tag})
sha256sums=(SKIP)

pkgver() {
  cd quart-cors
  git describe --tags
}

build() {
  cd quart-cors
  python -m build -wn
}

check() {
  cd quart-cors
  local python_version=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')
  SETUPTOOLS_USE_DISTUTILS=stdlib \
  tox -e "py${python_version}"
}

package() {
  python -m installer --destdir="${pkgdir}" quart-cors/dist/*.whl
  install -Dm 644 quart-cors/LICENSE -t "${pkgdir}"/usr/share/licenses/python-quart-cors/
}

# vim: ts=2 sw=2 et:
